<script src="@{'/public/javascripts/jquery/jquery-1.9.0.min.js'}" type="text/javascript" charset="UTF-8"></script>
<link rel="stylesheet" media="screen" href="@{'/public/stylesheets/gbutton/css/css3-buttons.css'}">

<table width="100%">
	<tr>
		<th><a href="javascript:void(0)" class="button middle" onclick="javascript:saveChosenSwBuild();"><span class="icon icon44"></span><span class="label">OK</span></a></th>
		<th>Release</th>
		<th>Build</th>
	</tr>
    %{
	for(swBuild in dasSwBuild) { 
	}%
	     <tr>
	     	<td><input name="sw_build" type="checkbox" value="${swBuild.release},${swBuild.build},${swBuild.id}" class="checkbox_sw_build" /></td>
	     	<td>${swBuild.release}</td>
	     	<td>${swBuild.build}</td>
	     </tr>
	%{
	     }
	}%
</table>

<script>
function saveChosenSwBuild() {
	
	var strTemp = "";
	
	$(".checkbox_sw_build:checked").each(function() {
		strTemp += $(this).val() + ";";
	});
	
	var str = strTemp.substr(0, strTemp.length - 1);
	var strArr = new Array();
	strArr = str.split(";");
	for(var i = 0; i < strArr.length; i++) {
		window.parent.appentTable(strArr[i].split(",")[0], strArr[i].split(",")[1],strArr[i].split(",")[2]);
	}
	window.parent.updateSB();
	
	/* close thickbox */
	top.tb_remove();
}
</script>